package com.szt.mobile.inventory.common.utils;

import android.content.Context;
import android.net.ConnectivityManager;

/**
 * @author 刘育成
 * @package com.szt.mobile.inventory.common.utils
 * @fileName Network
 * @date or 2019/1/29 18:18
 * @describe TODO
 */
public class Network {
    public static boolean isOpenNetwork(Context context){
        ConnectivityManager connManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
        if(connManager.getActiveNetworkInfo() != null) {
            return connManager.getActiveNetworkInfo().isAvailable();
        }
        return false;
    }
}
